package servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import Dao.Daogouwuche;
import Dao.impl.Daoimplgouwuche;
@WebServlet(name="g_jian",urlPatterns="/g_jian.do")
public class g_jian extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String ming = request.getParameter("name");
		
		HttpSession session1 = request.getSession();
		int sq=0;
		try {
			sq = (Integer) session1.getAttribute("che");
		} catch (NullPointerException e) {
			request.getRequestDispatcher("denglu.jsp").forward(request, response);
		}
		
		Daogouwuche dao = new Daoimplgouwuche();
		boolean pan = dao.jianupd(sq, ming);
		
		PrintWriter out = response.getWriter();
		
		
		if(pan){
			out.print("-");
			out.flush();
			out.close();
		}else{
			out.print("-");
			out.flush();
			out.close();
		}
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
